/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * adresse.java
 *
 * Created on 7 nov. 2010, 13:54:54
 */

package com.test.gui.swing.components.panel;

import javax.swing.GroupLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.LayoutStyle;

/**
 *
 * @author user
 */
public class pnlAdressePostale extends JPanel {

    public pnlAdressePostale() {
        initComponents();
        this.setSize(340, 168);
    }

    private void initComponents() {

        

        txfLigne1 = new JTextField();
        txfLigne2 = new JTextField();
        lblAdresse = new JLabel("Adresse");

        this.ltfNumero = new lbzHrzTextField2("N°", "Voie", 30);
        this.ltfCity =  new lbzHrzTextField2("Code", "Ville", 10);

        this.ltfPays = new lbzHrzTextField("Pays",12);

        GroupLayout layout = new GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
            
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(ltfNumero)
                    .addComponent(txfLigne2, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)
                    .addComponent(txfLigne1, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)
                    .addComponent(ltfCity)
                    .addComponent(ltfPays)
                     )
                )
            .addGroup(layout.createSequentialGroup()
                .addComponent(lblAdresse)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(lblAdresse)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ltfNumero)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txfLigne1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txfLigne2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ltfCity)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ltfPays)
                )
        );
    }

    public String getAdresseNumero(){
        return ltfNumero.getTextLeft();
    }

    public String getAdresseVoie(){
         return ltfNumero.getTextRight();
    }

    public String getAdresseLigne1(){
         return txfLigne1.getText();
    }

    public String getAdresseLigne2(){
        return txfLigne2.getText();
    }

    public String getAdresseCode(){
        return ltfCity.getTextLeft();
    }

    public String getAdresseVille(){
         return ltfCity.getTextRight();
    }

    public String getAdressePays(){
         return ltfPays.getText();
    }


    private JLabel lblAdresse;
    private lbzHrzTextField2 ltfNumero;

    private JTextField txfLigne1;
    private JTextField txfLigne2;
    private lbzHrzTextField2 ltfCity;

    private lbzHrzTextField ltfPays;


}
